package day04;

import java.util.Scanner;

/**
 * 1 使用键盘扫描器Scanner接收用户输入的数据
 * 2 Math.random()输出随机数：0.0到0.9999999999999999999...
 * @author XingHaiYang
 * @date 2022/9/6 15:41
 */
public class ScannerDemo {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);//Ctrl+Alt+v
        System.out.println("请输入年龄：");
        int age = scanner.nextInt();
        System.out.println("请输入商品价格：");
        double price = scanner.nextDouble();
        System.out.println("年龄为："+age+";价格为："+price);

        //0.0到0.9999999999999999999...
        System.out.println(Math.random());

    }
}
